package mysqlServer

import (
	"github.com/e421083458/golang_common/lib"
	"github.com/e421083458/gorm"
	"sync"
)

var dbLink sync.Once

//业务数据库
var BusinessDB *gorm.DB

//
func InitDB() error {

	var err error

	dbLink.Do(func() {
		db2, errDb2 := lib.GetGormPool("business")
		if errDb2 != nil {
			err = errDb2
		}
		BusinessDB = db2
	})
	return err
}
